<template>
  <div :class="[`nav-theme-${navTheme}`, `nav-layout-${navLayout}`]">
    <a-layout id="components-layout-demo-side" style="min-height: 100vh">
    <a-layout-sider v-if="navLayout == 'left'" :theme="navTheme" :trigger="null" v-model="collapsed" collapsible width="256px">
      <div class="logo">
        Ant Design Vue Pro
      </div>
      <SiderMenu :theme="navTheme" />
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0" >
        <a-icon v-auth="['admin']" class="trigger" :type="collapsed ? 'menu' : 'menu-fold'" @click="collapsed = !collapsed"></a-icon>
        <Header/>
      </a-layout-header>
      <a-layout-content style="margin: 0 16px">
        <router-view></router-view>
      </a-layout-content>
      <a-layout-footer style="text-align: center">
        <Footer/>
      </a-layout-footer>
    </a-layout>
  </a-layout> 
  <Authorized :authority="['admin']">
  <SettingDrawer />
  </Authorized>
  </div>
</template>

<script>
import Header from './Header'
import Footer from './Footer'
import SiderMenu from './SiderMenu'
import SettingDrawer from '../components/SettingDrawer'
// import Authorized from '../components/Authorized.vue'
export default {
  name: '',
  data () {
    return {
      collapsed: false,
    }
  },
  components: {
    Header,
    Footer,
    SiderMenu,
    SettingDrawer
    // Authorized
  },
  computed: {
    navTheme() {
      return this.$route.query.navTheme || 'dark'
    },
    navLayout() {
      return this.$route.query.navLayout || 'left'
    },
  },
  methods: {},
  created() {},
  mounted() {},
}
</script>

<style lang="less" scoped>
.trigger{
  padding: 0 20px;
  font-size: 20px;
  line-height: 64px;
}
.trigger:hover{background: #eee;}
.nav-theme-dark /deep/ .logo{
  color: #fff;
}
.nav-theme-light /deep/ .logo{
  color: #333;
}
.logo{font-size: 20px;line-height: 64px;text-align: center;
white-space:nowrap; /* 不换行 */  
overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */  
text-overflow:ellipsis;
}
</style>